package com.fhz.shop.ui.details;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.ViewModel;

import com.fhz.shop.callback.ApiResponse;
import com.fhz.shop.entity.GoodsInfoLocal;
import com.fhz.shop.entity.UserCart;
import com.fhz.shop.ui.details.DetailsRepository;

import javax.inject.Inject;

import dagger.hilt.android.lifecycle.HiltViewModel;
import retrofit2.http.Path;

/**
 * 时间:2023/8/29
 *
 * @author Mr.Feng
 * 简述: TODO
 */
@HiltViewModel
public class DetailsViewModel extends ViewModel {

    @Inject
    DetailsRepository mDetailsRepository;

    @Inject
    public DetailsViewModel() {
    }

    public LiveData<ApiResponse<GoodsInfoLocal>> getGoodsDetails( int id){
        return mDetailsRepository.getGoodsDetails(id);
    }

    public LiveData<ApiResponse<UserCart>> addCart(UserCart userCart){
        return mDetailsRepository.addCart(userCart);
    }
}
